//
//  BaseNavController.swift
//  Weibo
//
//  Created by 孙成宇 on 15/12/2.
//  Copyright © 2015年 mac. All rights reserved.
//

import UIKit

class BaseNavController: UINavigationController {

    override func viewDidLoad() {
        super.viewDidLoad()

    }



    override func pushViewController(viewController: UIViewController, animated: Bool) {
        if childViewControllers.count != 0 {
            viewController.hidesBottomBarWhenPushed = true
            viewController.navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .Plain, target: self, action: "close")




        }
        super.pushViewController(viewController, animated: true)


    }

    
    @objc private func back() {
        navigationController?.popToRootViewControllerAnimated(true)
        
    }
}
